<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"  http://www.w3.org/TR/html4/loose.dtd">  
<html>  
    <head>  
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">  
             <link rel="stylesheet" type="text/css" href="jsp/style.css" />
        <script TYPE="text/javascript">
      function emailcheck(str) {

    	  var at="@";
    	  var dot=".";
    	  var lat=str.indexOf(at);
    	  var lstr=str.length;
    	  var ldot=str.indexOf(dot);
    	  if (str.indexOf(at)==-1){
    	  alert("Invalid E-mail ID");
    	  return false;
    	  }

    	  if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
    	  alert("Invalid E-mail ID");
    	  return false;
    	  }

    	  if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
    	  alert("Invalid E-mail ID");
    	  return false;
    	  }

    	  if (str.indexOf(at,(lat+1))!=-1){
    	  alert("Invalid E-mail ID");
    	  return false;
    	  }

    	  if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
    	  alert("Invalid E-mail ID");
    	  return false;
    	  }

    	  if (str.indexOf(dot,(lat+2))==-1){
    	  alert("Invalid E-mail ID");
    	  return false;
    	  }

    	  if (str.indexOf(" ")!=-1){
    	  alert("Invalid E-mail ID");
    	  return false;
    	  }
    	 
    	  return true;
    	  }

    	 
     
      function validate(){
     
      if(document.frm.firstname.value=="")
      {
   alert("Please enter first name");
   document.frm.firstname.focus();
   return false;
      }
      if(document.frm.lastname.value=="")
      {
   alert("Please enter last name");
   document.frm.lastname.focus();
   return false;
      }
      if(document.frm.lastname.value=="")
      {
   alert("Please enter username");
   document.frm.username.focus();
   return false;
      }
      if(document.frm.lastname.value=="")
      {
   alert("Please enter password");
   document.frm.password.focus();
   return false;
      }
     
      if(document.frm.email.value=="")
      {
   alert("Please enter email");
   document.frm.email.focus();
   return false;
      }
      
      var emailID=document.frm.email;

	  if ((emailID.value==null)||(emailID.value=="")){
	  alert("Please Enter your Email Address");
	  emailID.focus();
	  return false;
	  }
	  
	  if (emailcheck(emailID.value)==false){
	  emailID.value="";
	  emailID.focus();
	  return false;
	  }
	 
      if(document.frm.state.value=="")
     {
   alert("Please enter state");
   document.frm.state.focus();
   return false;
      }
      if(document.frm.city.value=="")
      {
   alert("Please enter city");
   document.frm.city.focus();
   return false;
      }
      if(document.frm.zipcode.value=="")
      {
   alert("Please enter zipcode");
   document.frm.country.focus();
   return false;
      }
      return true;
 }
      </script>
        <title>Profile</title>  
    </head>  
    <body>  
  <div id="container">
		<div id="header">
		<center><img src="../../images/video-library-logo-2.jpg" align="center" height="80px" width="250px" alt="" /></center>
        	
             </div>   
        
        <div id="menu">
        	<ul>
            	<li class="menuitem"><a href="SearchMovies.jsp">Home</a></li>
                <li class="menuitem"><a href="SearchMovies.jsp">Search Movie</a></li>
                <li class="menuitem"><a href="Profile.jsp">Profile</a></li>
                <li class="menuitem"><a href="Balance.jsp">Balance</a></li>
                <li class="menuitem"><a href="Cart.jsp">Cart</a></li>
              <li class="menuitem"><a href="Fine.jsp">Fine</a></li>
                 <li class="menuitem"><a href="IssuedMovies.jsp">Issued Movies</a></li>
              <li class="menuitem"><a href="ContactUS.jsp">Contact Us</a></li>
              

            </ul>
        </div>
        
        <div id="leftmenu">

        </div>            
                
        
        
        
		<div id="content">
       
             
        
        <div id="content_top"></div>
        <div id="content_main">
          
        <form name="frm" method="post"  onsubmit="return validate();">  
          <CENTER>  
            <TABLE border="0"width="600px">  
            
                <tr><td><h1>Profile</h1></td></tr>
                             <tr><td></td></tr>
  <TR>  
   <TD width="150px"><b>First Name:</b></TD>  
   <TD>  
                            <INPUT TYPE="text" NAME="firstname" id="firstname" value="">  
                        </TD>  
                        
                </TR>  
  <TR>  
  <TR>  
   <TD width="150px"><b>Last Name:</b></TD>  
   <TD>  
                            <INPUT TYPE="text" NAME="lastname" id="lastname" value="">  
                        </TD>  
                        
                </TR>  
                 <TR>  
  
 <TD><b>User Name:</b></TD>
      <TD ><INPUT TYPE="text" NAME="username" id="username" value="" >
       </TD>
      </TR>
      
      <TR>
      <TR>
      <TD><b>Email:</b></TD>
      <TD><INPUT TYPE="TEXT" NAME="email" id="email" value="" >
       </TD>
      </TR>
       <TR>
      <TD><b>Address:</b></TD>
      <TD><INPUT TYPE="TEXT" NAME="address" id="address" value="">
       </TD>
      </TR>
      
     <TR>
      <TD> <b>City:</b></TD>
      <TD><INPUT TYPE="TEXT" NAME="city" id="city" value="">
       </TD>
      </TR>
       <TR>
      <TD><b>State:</b></TD>
      <TD><INPUT TYPE="TEXT" NAME="state" id="state" value="">
       </TD>
      </TR>
     
       <TR>
      <TD> <b>Zipcode:</b></TD>
      <TD><INPUT TYPE="TEXT" NAME="zipcode" id="zipcode" value="">
    </TD>
      </TR>
                <TR>
      <TD> <b>Member type:</b></TD>
      <TD> <INPUT TYPE="radio" NAME="Membertype" id="memtype" value="" CHECKED>
             Simple Customer
            <BR>
            <INPUT TYPE="radio" NAME="Membertype" id="memtype" value="">
            Premium Member
            <BR>
            
      
     </TD>
      </TR>
            
                 <TR>  
   <TD width="150px"><b>Outstanding Movies:</b></TD>  
   <TD>  
                           <SELECT  NAME="Movies"  >
								<Option value="">default</option>
							</SELECT>
                        </TD>  
                         
                </TR> 
               
  <TR>  
   <TD colspan="2" align="center">  
                           <INPUT TYPE="submit" value="Update" > 
                        </TD>  
                        <TD>  
                            &nbsp;  
                        </TD>  
  </TR>  
  <tr><td></td></tr>
  <tr><tr>
 
            </TABLE>  
                    </CENTER>  
                    
                 <center> <h3> Click <a href="ChangePassword.jsp">here </a>to Change your Password</h3></center>
        </form>  
         </div>
       
            
        <div id="content_bottom"></div>
      
    </body>  
</html>  